package com.banshuibao.bsb_android.util;

import java.io.File;

/**
 * Created by wangpan on 2017/12/29.
 */

public class ClearDirUtil {
    public static void  clearAll(File file){
        if(file.isFile()){
            file.delete();
            return;
        }
        if(file.isDirectory()){
            File[] childFile = file.listFiles();
            if(childFile == null || childFile.length == 0){
                file.delete();
                return;
            }
            for(File f : childFile){
                clearAll(f);
            }
            file.delete();
        }
    }
}
